<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../common/base_body_header.jsp" %>
<%@include file="../common/navbar.jsp" %>
<%@include file="../common/page_content_pre.jsp" %>
<div class="page-content">
    <div class="row">
        <div class="col-sm-12">
            <button class="btn btn-xs btn-success" id="add_btn">
                添加
                <i class="icon-plus align-top bigger-125 icon-on-right"></i>
            </button>
        </div>
        <div class="col-sm-12">
            <div class="table-responsive">
                <table id="list-table" class="table table-striped table-bordered table-hover" width="100%">
                    <thead>
                    <tr>
                        <th style="text-align:center;">好友二维码</th>
                        <th style="text-align:center;">付款码</th>
                        <th style="text-align:center;">操作</th>
                    </tr>
                    </thead>
                    <c:if test="${not empty QRCode}">

                        <c:forEach items="${QRCode}" var="item" varStatus="cuorseStatus">
                            <tr>
                                <td><img src="${item.myQRCode}" width="100px" height="100px">
                                </td>
                                <td><img src="${item.payQRCode}" width="100px" height="100px">
                                </td>
                                <td>
                                    <button class='football-del btn btn-xs btn-danger' onclick="delClick(${item.id})"><i
                                            class='icon-trash bigger-120'></i></button>
                                </td>
                            </tr>
                        </c:forEach>
                    </c:if>
                </table>
            </div>
        </div>
    </div>
</div>
<%@include file="../common/page_content_suf.jsp" %>
<%@include file="../common/script.jsp" %>
<script type="text/javascript">

    jQuery(function ($) {
        $("#add_btn").on("click", function () {
            addClick();
        });
    });

    var addClick = function () {
        document.location.href = "${GLOBAL.basePath}/Emily/addQRCode";
    };

    var delClick = function (obj) {
        layer.confirm("确定要删除吗？", {
            title: '提示',
            btn: ['确认', '取消'], //按钮
            area: ['auto', 'auto'] //宽高
        }, function () {
            document.location.href = "${GLOBAL.basePath}/Emily/deleteCode?codeId=" + obj;
        })
    }
</script>
